package com.ma.server.Impl;

import com.ma.Dao.teamDao;
import com.ma.entity.Student;
import com.ma.entity.Team;
import com.ma.server.teamServer;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

/**
 * @ProjectName: project
 * @Package: com.ma.server.Impl
 * @ClassName: teamServerImpl
 * @Author: YHHHH
 * @Description: 服务实现类
 * @Date: 2021/3/3 14:19
 * @Version: 1.0
 */
@Service
public class teamServerImpl implements teamServer {

    @Autowired
    private teamDao teamDao;


//    @Override
//    public List<Map<String ,Object>> findAllTeam1() {
//        List<Map<String ,Object>> allTeam = teamDao.findAllTeam1();
//        return allTeam;
//    }
    @Override
    public List<Team> findAllTeam() {
        List<Team> allTeam = teamDao.findAllTeam();
        return allTeam;
    }

    @Override
    public void joinTeam(Integer teamId, Integer studentID) {
        teamDao.joinTeam(teamId,studentID);
    }

    @Override
    public Integer addTeam(Team team) {
        Integer addTeam = teamDao.addTeam(team);
        return addTeam;
    }

    @Override
    public String findLeader(Integer teamID) {
        String leader = teamDao.findLeader(teamID);
        return leader;
    }

    @Override
    public String findLeaderName(Integer teamID) {
        String leaderName = teamDao.findLeaderName(teamID);
        return leaderName;
    }

    @Override
    public List<Team> findTeamData(Integer teamId) {
        List<Team> teamData = teamDao.findTeamData(teamId);
        return teamData;
    }

    @Override
    public Integer updateProject(Integer teamId, Integer projectId) {
        Integer integer = teamDao.updateProject(teamId, projectId);
        return integer;
    }

    @Override
    public Integer findProject(Integer teamId) {
        Integer project = teamDao.findProject(teamId);
        return project;
    }

    @Override
    public Integer updateScore(Integer score, Integer teamId) {
        Integer integer = teamDao.updateScore(score, teamId);
        return integer;

    }

    @Override
    public Integer updateStudentScore(Integer teamId) {
        Integer integer = teamDao.updateStudentScore(teamId);
        return integer;

    }
}
